class Solution:
    def firstUniqChar(self, s: str) -> int:
        charHash = [None] * 26
        n = len(s)+1
        a = ord('a')
        for i in range(len(s)):
            index = ord(s[i]) - a
            if charHash[index] is None:
                charHash[index] = i
            else:
                charHash[index] = n+1
        tmp = n
        for i in charHash:
            if i is not None:
                tmp = min(tmp, i)
        return tmp if tmp!=n else -1



if __name__ == '__main__':
    so = Solution()
    s = ""
    r = so.firstUniqChar(s)
    print(r)
